#supposed to be the default class for animated objects in the game, i don't think it's in use at the moment though
class obj_c:
    def __init__(self, x, y, xVel, yVel, anim):
        self.x=x
        self.y=y
        self.xVel=xVel
        self.yVel=yVel
        self.anim=anim
        self.frame=0
    
    def move(self):
        self.x+=self.xVel
        self.y+=self.yVel
        if self.xVel>0:
            self.xVel-=slowRate
            if self.xVel<0:
                self.xVel=0
        if self.xVel<0:
            self.xVel+=slowRate
            if self.xVel>0:
                self.xVel=0
        
        self.yVel+=slowRate
        
    def draw(self):
        self.frame, animEnded=self.anim.draw(self.x, self.y, self.frame, True, True)

#checks if a pixel is clear
def isBlack(x, y, surfToCheck):
    if not isOutsideBounds(x, y, surfToCheck):
        inColor=surfToCheck.get_at((x, y))
        if inColor[0]==0 and inColor[1]==0 and inColor[2]==0:
            return True
        else:
            return False
    else:
        return True

#checks if a pixel is out of bounds for the surface passed in
def isOutsideBounds(x, y, surfToCheck):
    if x >= surfToCheck.get_width() or y >= surfToCheck.get_height() or x < 0 or y < 0:
        return True
        print "Out of bounds!"
    else:
        return False
